package com.devshephard.jucks.SingleDemo;


/**
 * 静态内部类单例模式,线程安全的
 */
public class Holder {

    //单例模式必须构造器私有
    private Holder() {
    }

    public static Holder getInstance(){
        return InnerClass.HOLDER;
    }

    public static class InnerClass{
        private static final Holder HOLDER = new Holder();
    }
}
